package com.yfp.operation.mapper;

import com.yfp.operation.domain.Client;
import com.yfp.operation.domain.MarCouponDirectional;
import com.yfp.operation.domain.dto.MarCouponPackReceiveUserReqDTO;
import com.yfp.operation.domain.dto.SurplusFundingDTO;
import com.yfp.operation.domain.vo.StoredBillVO;
import com.yfp.operation.domain.dto.UserLayerTotalUserDTO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @Description: 客户Mapper
 *
 * @CreateDate: 2024/5/16 9:59
 * @UpdateUser:
 * @UpdateDate: 2024/5/16 9:59
 * @UpdateRemark: 暂无修改
 * @Version: 1.0
 */
@Mapper
public interface ClientMapper {

    List<Client> findList(Client client);

    Client getById(String id);

    Client getByOpenId(String openId);

    void insert(Client client);

    Client findByMobile(String mobile);

    void edit(Client client);

    void clearOpenId(String id);

    /**
     * 获取客户id
     * @param cityName
     * @return
     */
    List<String> selectByCityName(String cityName);

    /**
     * 根据手机号获取数据
     *
     * @param mobileList
     * @return
     */
    List<MarCouponDirectional> getByMobiles(@Param("mobileList") List<String> mobileList);

    /**
     * 根据礼包id查询客户列表
     *
     * @param couponPackId
     * @return
     */
    List<Client> selectByCouponPackId(MarCouponPackReceiveUserReqDTO couponPackId);

    List<Client> listByUserLayerTotalUserDTO(@Param("userLayerDTO") UserLayerTotalUserDTO userLayerDTO, @Param("mobileList") List<String> mobileList);

    void updateLabelById(Client client1);

    /**
     * 增加抽奖次数
     * @param clientId
     */
    void addLotteryNum(String clientId);

    List<Client> selectByUserIds(@Param("clientIdList") List<String> clientIdList);

    /**
     * 储值余额管理列表
     * @param surplusFundingDTO
     * @return
     */
    List<StoredBillVO> surplusFunding(SurplusFundingDTO surplusFundingDTO);

    /**
     * 给进社群的新客户打点位标签
     */
    List<Client> getClientPosition();

    /**
     * 更新点位标签
     * @param clients
     */
    void updatePositionId(@Param("clients") List<Client> clients);

    /**
     * 修改点位标签
     * @param clientId
     * @param positionId
     */
    void amendPositionId(@Param("clientId") String clientId, @Param("positionId") String positionId);
}
